<?php
namespace App\Api;
use PhalApi\Api;
var_dump(333);exit;
$api_sign = 'DdbBTu9Qnh19HcS2xRirzpJTrUKDi9aq7abtGJAj5yqW69Xlog0PQejRDwpC3wuUI6mxkljgFdJ5LFxJodu8Hzg8SLfdSoopmQMHFmn88GWmteTqwfaF2vNwbWK5cXIbCZnshFGCh0pYAOEi4CRZsPkrsviOTWUkOVBLvU1AY3gyN0kh4NSq4Ke3BRRZePg2YDL6Id4xtqobHsVfGHwEIMXUK2VGOEvi1m5zZyuPf0AYMaZQWYuhLM0SBPTXrMN95B38Exayc1Elk7QAct72Vtfzsvc6jel1N4lICnO7X7Vr';//接口签名密钥

$data = $_POST;

$hash_src = '';
$hash_key = array('failure_code', 'invoice_id', 'order_no');
foreach ($hash_key as $key) {
    $hash_src .= $data[$key];
}
$hash_src = $hash_src . $api_sign;
$hash = hash('sha256', $hash_src);// sha256 算法


if ($data['token'] != $hash) {//签名验证
    echo  'fail';
}else{
    if ($data['failure_code'] == 'success') { // 成功
        //订单成功
    }else {
        //订单失败
    }    
    echo 200;
}